package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.Member;
import org.apache.ibatis.annotations.Select;

public interface MemberMapper extends BaseMapper<Member> {

    @Select("select count(*) from t_member where regTime= CURDATE()")
    long todayNewMember();

    @Select("select count(*) from t_member where regTime between SUBDATE(CURDATE(),DATE_FORMAT(CURDATE(),'%w')-1) and SUBDATE(CURDATE(),DATE_FORMAT(CURDATE(),'%w')-7)")
    long weekNewMember();

    @Select("select count(*) from t_member where regTime between DATE_ADD(CURDATE(),INTERVAL -DAY(CURDATE())+1 DAY) and LAST_DAY(CURDATE())")
    long monthNewMember();

    @Select("select count(*) from t_member")
    long memberCount();
}
